/**
 * Copyright (C) 2013-2014 EaseMob Technologies. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *     http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.century.sjt.EMChat.domain;

import com.easemob.chat.EMContact;

public class EaseUser extends EMContact {
    
//标志位 是否 为商家 0：用户 1：商家
	protected String isShop;
// 商家id
	private String ShopId;
//      昵称首字母
	protected String initialLetter;
//	  用户头像
	protected String avatar;
	//用户头像ID
	protected String avatarid;
	//用户昵称
	protected String nick;
	//用户手机号码
	protected String mobile;

	public String getIsShop() {
		return isShop;
	}

	public void setIsShop(String isShop) {
		this.isShop = isShop;
	}

	public String getShopId() {
		return ShopId;
	}

	public void setShopId(String shopId) {
		ShopId = shopId;
	}

	public EaseUser(String username){
	    this.username = username;
	}

	public String getInitialLetter() {
		return initialLetter;
	}

	public void setInitialLetter(String initialLetter) {
		this.initialLetter = initialLetter;
	}


	public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    @Override
	public int hashCode() {
		return 17 * getUsername().hashCode();
	}

	@Override
	public boolean equals(Object o) {
		if (o == null || !(o instanceof EaseUser)) {
			return false;
		}
		return getUsername().equals(((EaseUser) o).getUsername());
	}

	@Override
	public String toString() {
		return nick == null ? username : nick;
	}

	@Override
	public String getNick() {
		if (nick==null||"".equals(nick.trim())){
			return "世纪通用户";
		}
		return nick.trim();
	}

	@Override
	public void setNick(String nick) {
		this.nick = nick;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getAvatarid() {
		return avatarid;
	}

	public void setAvatarid(String avatarid) {
		this.avatarid = avatarid;
	}
}
